const fs = require('fs')
const marked = require('marked')
const jsonfile = require('jsonfile')

fs.readFile('test/test.md', (err, data) => {
  if (err) throw err
  markdown_data = data.toString().split('---')[1]
 
  const json = `{${markdown_data}}`
  fs.writeFile('test/test.json', json, (err) => {
    if (err) throw err
    console.log('doen')
  })
})